using D.Application.Services;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System;
using System.Threading.Tasks;

namespace D.API.Pages.Api
{
    public class RealTimeRegistrationModel : PageModel
    {
        private readonly RegistrationService _registrationService;

        public RealTimeRegistrationModel(RegistrationService registrationService)
        {
            _registrationService = registrationService;
        }

        public async Task<IActionResult> OnGetAsync()
        {
            var registrations = await _registrationService.GetRealTimeRegistrationsAsync(patientName, phoneNumber, department, registrationDate);
            return new JsonResult(registrations);
        }
    }
}
